package people.paper.tv.activity.home.modual.rmrb.view.impl;

import android.content.Context;
import android.support.annotation.NonNull;
import android.view.Gravity;
import android.widget.FrameLayout;
import android.widget.ImageView;

import com.skyworth.util.Util;

import people.paper.tv.R;
import people.paper.tv.utils.ui.MarqueeTextView;

public class ItemView extends FrameLayout {
    FrameLayout contentLayout;
    MarqueeTextView title;
    int curPosition;
    boolean isLayout;
    int width;

    public ItemView(@NonNull Context context, boolean layout) {
        super(context);
        isLayout = layout;
        setFocusable(true);
        setFocusableInTouchMode(true);

        if(isLayout){
            width = Util.Div(270);
        }else {
            width = Util.Div(636);
        }
        contentLayout = new FrameLayout(context);
        addView(contentLayout, new LayoutParams(width, Util.Div(120)));

        title = new MarqueeTextView(context);
        title.setTextSize(Util.Dpi(36));
        title.setTextColor(getResources().getColor(R.color.title_unfocus));
        LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT, Gravity.CENTER_VERTICAL);
        params.leftMargin = Util.Div(60);
        params.rightMargin = Util.Div(60);
        contentLayout.addView(title, params);
    }

    public void onClickAction() {

    }

    public void onFocusChange(boolean hasFocus) {

    }

}
